Repository navigation
fix(libc): treat directories as case-insensitive when the host cannot report case sensitivity - #22683
Conversation
… report case sensitivity CaseInsensitiveDirectoryWindows treated any failure of the FileCaseSensitiveInfo query as a case-sensitive directory. Hosts that cannot answer it look names up case-insensitively; Wine fails the query with ERROR_CALL_NOT_IMPLEMENTED. MatchNames then listed the whole directory for every lookup of a missing name instead of one FindFirstFileExW for that name. The errors a host gives for an unsupported information class now mean case-insensitive; other failures keep the previous behaviour.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head f3d0378c8049fea14a2ea2952da29c6a80095dbb; no commands or tests were run. Read the prepared description, commits, manifest, diff, and the changed General.cpp ranges covering the changed function and its callers. No files were excluded from the review manifest.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | One changed source file |
| Automated tests | not run | No test run performed |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports Windows/Wine and game-loading measurements; these were not independently verified. The AnyPS5 test suite was not run. No other files were read.
To get this to a good state
Nothing is required.
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
What
CaseInsensitiveDirectoryWindowstreats any failure of theFileCaseSensitiveInfoquery as a case-sensitive directory. Hosts without per-directory case sensitivity answer that query with an error but look names up case-insensitively. Wine returnsERROR_CALL_NOT_IMPLEMENTED(checked on Wine 11.22). Windows versions or file systems that don't support this information class are expected to fail withERROR_INVALID_PARAMETERorERROR_NOT_SUPPORTED; I haven't checked those. On those hostsMatchNamesthen lists the whole directory throughstd::filesystem::directory_iteratorfor every lookup of a missing name, instead of oneFindFirstFileExWfor that name.With this change, those errors (
ERROR_CALL_NOT_IMPLEMENTED,ERROR_INVALID_PARAMETER,ERROR_NOT_SUPPORTED,ERROR_INVALID_FUNCTION) mean "case-insensitive". Any other failure keeps today's behaviour, and hosts that answer the query are unchanged.MatchNamesWindowsfiltersFindFirstFileExWresults with the sameSameNamecomparison the listing uses, so the matched names are the same.Tested
CaseInsensitiveDirectoryWindowsandMatchNamesare unchanged on currentmain, so the change was made on 319621b first and moved here as is.GetFileInformationByHandleEx(..., FileCaseSensitiveInfo, ...)fails with error 120. A missing-name lookup in a 279-entry directory took 97 us throughFindFirstFileExWand 852 us through a full listing (small MinGW program, same directory).main. The behaviour only changes on hosts where the query fails, which CI's Windows runners don't produce.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)